package com.example.maze.swing;

import com.example.maze.model.Coordinate;
import com.example.maze.solver.SolverResult;

import java.util.List;

/**
 * 动画寻路结果类，包含步骤信息
 * 
 * @author maze-demo
 */
public class AnimatedSolverResult extends SolverResult {
    
    private final List<SolverStep> steps;
    
    public AnimatedSolverResult(String algorithmName, List<Coordinate> path, 
                               int visitedCells, long timeMillis, List<SolverStep> steps) {
        super(algorithmName, path, visitedCells, timeMillis);
        this.steps = steps;
    }
    
    public static AnimatedSolverResult notFound(String algorithmName, int visitedCells, 
                                               long timeMillis, List<SolverStep> steps) {
        AnimatedSolverResult result = new AnimatedSolverResult(
            algorithmName, null, visitedCells, timeMillis, steps);
        return result;
    }
    
    /**
     * 获取所有寻路步骤
     * 
     * @return 步骤列表
     */
    public List<SolverStep> getSteps() {
        return steps;
    }
    
    /**
     * 获取步骤总数
     * 
     * @return 步骤数量
     */
    public int getStepCount() {
        return steps != null ? steps.size() : 0;
    }
}